from flask_wtf import Form
#from flask import  FlaskForm
from wtforms.validators import DataRequired, Length
from wtforms import StringField, BooleanField, PasswordField, TextField, TextAreaField,FileField


class LoginForm(Form):
    username = StringField('User Name', validators=[DataRequired()])
    password = PasswordField('Password', validators=[DataRequired()])
    remember_me = BooleanField('remember me', default=False)


class EditForm(Form):
    username = StringField('username', validators=[DataRequired()])
    about_me = TextAreaField('about_me', validators=[Length(min=0, max=140)])
    avator = FileField('avator')

class AddpostForm(Form):
    title = StringField('title', validators=[DataRequired()])
    body = TextAreaField('Blog Content', validators=[Length(min=0)])
    summary = StringField('summary', validators=[DataRequired()])
    tag = StringField('tag', validators=[DataRequired()])
class RegistryForm(Form):
    username = StringField('User Name', validators=[DataRequired()])
    password = PasswordField('Password', validators=[DataRequired()])
    repassword = PasswordField('Password', validators=[DataRequired()])
    email = StringField('Email', validators=[DataRequired()])

class MessageForm(Form):
    username = StringField('User Name', validators=[DataRequired()])
    message = TextAreaField('message', validators=[Length(min=0)])

class SearchForm(Form):
    search = StringField('search', validators = [DataRequired()])
